<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: FDB example code</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__bridgeif__fdb.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">FDB example code<div class="ingroups"><a class="el" href="group__netifs.html">NETIFs</a> &raquo; <a class="el" href="group__bridgeif.html">IEEE 802.1D bridge</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad912bfd3ce8e24d0eb48b7dc9de07c39"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__bridgeif__fdb.html#gad912bfd3ce8e24d0eb48b7dc9de07c39">bridgeif_fdb_update_src</a> (void *fdb_ptr, struct <a class="el" href="structeth__addr.html">eth_addr</a> *src_addr, u8_t port_idx)</td></tr>
<tr class="separator:gad912bfd3ce8e24d0eb48b7dc9de07c39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga616fb7404be5da79d8092b4a14976750"><td class="memItemLeft" align="right" valign="top">bridgeif_portmask_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__bridgeif__fdb.html#ga616fb7404be5da79d8092b4a14976750">bridgeif_fdb_get_dst_ports</a> (void *fdb_ptr, struct <a class="el" href="structeth__addr.html">eth_addr</a> *dst_addr)</td></tr>
<tr class="separator:ga616fb7404be5da79d8092b4a14976750"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf7935226ee7f99f964bf0135b6cb9ca0"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__bridgeif__fdb.html#gaf7935226ee7f99f964bf0135b6cb9ca0">bridgeif_fdb_init</a> (u16_t max_fdb_entries)</td></tr>
<tr class="separator:gaf7935226ee7f99f964bf0135b6cb9ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This file implements an example for an FDB (Forwarding DataBase) </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga616fb7404be5da79d8092b4a14976750"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga616fb7404be5da79d8092b4a14976750">&#9670;&nbsp;</a></span>bridgeif_fdb_get_dst_ports()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bridgeif_portmask_t bridgeif_fdb_get_dst_ports </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>fdb_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structeth__addr.html">eth_addr</a> *&#160;</td>
          <td class="paramname"><em>dst_addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Walk our list of auto-learnt fdb entries and return a port to forward or BR_FLOOD if unknown </p>

</div>
</div>
<a id="gaf7935226ee7f99f964bf0135b6cb9ca0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf7935226ee7f99f964bf0135b6cb9ca0">&#9670;&nbsp;</a></span>bridgeif_fdb_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* bridgeif_fdb_init </td>
          <td>(</td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>max_fdb_entries</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Init our simple fdb list </p>

</div>
</div>
<a id="gad912bfd3ce8e24d0eb48b7dc9de07c39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad912bfd3ce8e24d0eb48b7dc9de07c39">&#9670;&nbsp;</a></span>bridgeif_fdb_update_src()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void bridgeif_fdb_update_src </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>fdb_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structeth__addr.html">eth_addr</a> *&#160;</td>
          <td class="paramname"><em>src_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8_t&#160;</td>
          <td class="paramname"><em>port_idx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A real simple and slow implementation of an auto-learning forwarding database that remembers known src mac addresses to know which port to send frames destined for that mac address.</p>
<p>ATTENTION: This is meant as an example only, in real-world use, you should provide a better implementation :-) </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
